package algorithm.poj.p3000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.StringTokenizer;


/**
 * 分析：
 * 实现：
 * 经验：
 * 教训：
 * 分类：贪婪算法
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P3069 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P3069.class.getResource("P3069.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		String line = stdin.readLine();
		while (line != null && !"-1 -1".equals(line.trim())) {
			StringTokenizer st = new StringTokenizer(line);
			int R = Integer.valueOf(st.nextToken());
			int n = Integer.valueOf(st.nextToken());
			line = stdin.readLine();
			int[] positions = new int[n];
			st = new StringTokenizer(line);
			for (int i = 0; i < n; i ++) {
				positions[i] = Integer.valueOf(st.nextToken());
			}
			Arrays.sort(positions);
			int start = 0;
			int count = 0;
			for (; start < n;) {
				count ++;
				int index = start;
				while (index < n && positions[index] <= positions[start] + R) index ++;
				if (index == n) {
					break;
				} else {
					index --;
					int end = index;
					while (end < n && positions[end] <= positions[index] + R) end ++;
					if (end == n) {
						break;
					} else {
						start = end;
					}
				}
			}
			System.out.println(count);
			line = stdin.readLine();
		}
	}
}